package com.pure.common.bridge;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 抽象类 - 需不需要抽象看实际业务需要
 * @date: 2022-05-29 00:08
 * @since 1.2.0
 **/
@Slf4j
public abstract class BridgeAbstraction {

    private BridgeImplementor implementor;

    // 通过构造方法关联接口实现，使得两者可以独立变化
    public BridgeAbstraction(BridgeImplementor implementor) {
        this.implementor = implementor;
    }

    public void doWork() {

        log.info("糖水燕窝");

        printStr("甜甜的，真好吃 ...");
        // 渠道
        this.implementor.doSomething();
    }

    protected abstract void printStr(String content);

}
